package cn.hd01.web.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.hd01.repository.entity.Areas;
import cn.hd01.service.AreasService;
import cn.hd01.web.auth.Auth;

@Controller
@RequestMapping("/areas")
@Auth
public class AreasController {
	
	@Autowired
	private AreasService areasService;
	
	@ResponseBody
	@RequestMapping(path = "/list/{cityId}", method = RequestMethod.GET)
	private List<Areas> find(@PathVariable("cityId") Integer cityId) {
		return areasService.findByCityId(cityId);
	}

}
